home *** CD-ROM | disk | FTP | other *** search
- /************************************
- cDotsDoc.h
- ************************************/
-
- #define _H_cDotsDoc /* Include this file only once */
- #include <CDocument.h>
-
- #include "cDotsPane.h"
- #include "cScorePane.h"
- #include "dotsTypes.h"
-
- /*** Class Types ***/
- /* Types used to store state of game */
- typedef tLineState tLines[vLine+1][kMaxRow+1][kMaxCol+1];
- typedef tBoxState tBoxes[kMaxRow+1][kMaxCol+1];
-
-
- struct cDotsDoc : CDocument {
-
- /* Instance Variables */
- cDotsPane *fDotsPane; /* the view of the game */
- cScorePane *fScorePane; /* the view of the score */
- Boolean fPlayerTurn; /* whose turn */
- tLines fLines; /* state of every line */
- tBoxes fBoxes; /* state of every box */
-
- DialogPtr printBanner; /* inform user printing in progress */
-
- /* Initialization */
- void IDotsDoc(CBureaucrat *aSupervisor, Boolean printable);
-
- /* Override Methods */
- void NewFile(void);
- void OpenFile(SFReply *macSFReply);
- Boolean DoSave(void);
- Boolean DoSaveAs(SFReply *macSFReply);
- void DoRevert(void);
- short PageCount(void);
- void AboutToPrint(short *firstPage, short *lastPage);
- void PrintPageOfDoc(short pageNum);
- void DonePrinting(void);
-
- /* Additional Methods */
- void BuildWindow(Handle theData);
-
- void storeData(Handle theData);
- tBoxState getBoxState(int row, int col);
- Boolean getLineState(tLineDir direction, int row, int col);
- void setLineState(tLineDir direction, int row, int col, Boolean thePlayer, Boolean newState);
- Boolean changeBoxState(int row, int col, Boolean thePlayer, Boolean addingLine);
- Boolean getPlayerTurn(void);
- };